<%--
  Created by IntelliJ IDEA.
  User: 13236
  Date: 2018/6/7
  Time: 16:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html>
<head>
    <title>登录</title>
</head>
<body>
<%
    String uname="";
    String upassword="";
    if (request.getCookies()!=null){
        Cookie[] cookies=request.getCookies();
        for(Cookie c:cookies){
            if(c.getName().equals("username")){
                uname=c.getValue();
            }
            if(c.getName().equals("password")){
                upassword=c.getValue();
            }
        }
    }
%>
    <form action="logincookieservlet" method="post">
        <table>
            <tr>
                <td>用户名</td>
                <td><input type="text" name="name" id="name" value="<%=uname%>"></td>
            </tr>
            <tr>
                <td>密码</td>
                <td><input type="password" id="pwd" name="pwd" value="<%=upassword%>"></td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit" value="登录"></td>
            </tr>
        </table>
    </form>
</body>
</html>
